<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>12-案例-吾皇的心情之旅</title>
</head>
<body>
    <div id="app">
        <button @click="index--" v-show="index > 0">上一页</button>
        <div>
            <img :src="list[index]" alt="">
        </div>
        <button @click="index++" v-show="index < list.length - 1">下一页</button>
        
    </div>
    

    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#app',
            data:{
                index:0,
                list:[
                    './imgs/1.png',
                    './imgs/2.png',
                    './imgs/3.png',
                    './imgs/4.png',
                    './imgs/5.png',
                    './imgs/6.png',
                    './imgs/7.png',
                    './imgs/8.png',
                ]
            }
        })
    </script>
</body>
</html>